home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / Queries / PGetPrivateString.cpp < prev    next >
C/C++ Source or Header  |  1996-08-15  |  1KB  |  52 lines

  1. /*
  2.  *--- PGetPrivateString.cpp -----------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:43 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PGetPrivateString.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10. #include <string.h>
  11.  
  12. #include "PMCQErrs.h"
  13. #include "PGetPrivateString.h"
  14. #include "PQuery.h"
  15. #include "PRequestBuf.h"
  16. #include "PReplyBuf.h"
  17.  
  18. PGetPrivateString::PGetPrivateString
  19.   (    const char * sDeveloperID,
  20.     const char * sPluginID,
  21.     short cTargetClass,
  22.     unsigned long nTypeFlag,
  23.     unsigned long nTargetID )
  24.     
  25. : PHandleQuery()
  26.  
  27. {
  28.     if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
  29.         throw CQ_INVALID_CQ_ARG;
  30.         
  31.     PRequestBuf request(100);        // plenty big to hold everything.
  32.     request << sDeveloperID
  33.              << sPluginID
  34.             << cTargetClass
  35.             << nTypeFlag
  36.             << nTargetID;
  37.  
  38.     
  39.     // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
  40.     //   If the object has no private data, an exception
  41.     //   (CQ_NOPDATA) will be thrown.  If you don't want
  42.     //   your plug-in to fail, you must handle the exception.
  43.     PQuery query(pm_getprivatestring, request, itsHandle);
  44.     InitHandle();
  45.     
  46.     PReplyBuf reply(replyPtr);
  47.     
  48.     reply >> cPlatform >> &sPrivateString;    
  49. }
  50.  
  51. // end of PGetPrivateString.cpp
  52.